import axios from "@/api/config"
import {baseURL} from "@/api/ipconfig"

var ip = baseURL.URL1
export const commonUser = {
    //获取普通用户所有服务
    getCommonService: async () => {
        const url = ip+'/commonAdmin/service';
        let res = await axios.get(url);
        return res;
    },
    //获取普通用户所有服务
    getGroupList: async () => {
        const url =ip+ '/commonAdmin/group/list';
        let res = await axios.get(url);
        return res;
    },
    addUser:data=>axios.post(ip+'/commonAdmin/',data),
    getMessage:async (data) => {
        const url = ip+'/commonAdmin/'+data;
        let res = await axios.get(url);
        return res;
    },
    //编辑用户
    updateUser: async (data) => {
        const url = ip+'/commonAdmin/';
        let res = await axios.put(url,data);
        return res;
    },
    //分页查询
    getUserList:data=>axios.post(ip+'/commonAdmin/page/?unitId='+data.unitId,data.searchVo),

    //修改群组
    setUserUnit:async (data) => {
        const url = ip+'/commonAdmin/group/'+data.unitId+'/'+data.userId;
        let res = await axios.put(url);
        return res;
    },
}